'use strict';

const bcrypt = require('bcryptjs');

module.exports = {
  up: async (queryInterface, Sequelize) => {
    // 创建演示用户
    const hashedPassword = await bcrypt.hash('123456', 10);
    
    await queryInterface.bulkInsert('users', [
      {
        id: 1,
        username: 'demo',
        email: 'demo@example.com',
        password: hashedPassword,
        nickname: '演示用户',
        gender: 'female',
        height: 165,
        weight: 55,
        bio: '这是一个演示账户，用于展示衣柜搭配功能',
        status: 'active',
        created_at: new Date(),
        updated_at: new Date(),
      }
    ]);
  },

  down: async (queryInterface, Sequelize) => {
    await queryInterface.bulkDelete('users', { username: 'demo' }, {});
  },
};
